/**
 * @(#)com.pattern.p_02_observer.oo.InternTemplate
 *
 * Copyright (c) 2014-2018 上海纬视瑞科技有限公司
 *
 * DESC:
 *
 */
package com.pattern.p_02_observer.oo;

/**
 * 天气数据
 *
 * @author fusf
 * @version 1.0  2016/11/3
 */
public class WeatherData {

    private float temperature;//温度
    private float humidity;//气压
    private float pressure;//湿度

    CurrentConditions currentConditions;

    public WeatherData(CurrentConditions currentConditions) {
        this.currentConditions = currentConditions;
    }

    public WeatherData(float temperature, float humidity, float pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        this.pressure = pressure;
    }

    public void dataChange() {
        currentConditions.update(getTemperature(),getHumidity(),getPressure());
    }

    public void setData(float temperature, float humidity, float pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        this.pressure = pressure;
        dataChange();
    }

    public float getTemperature() {
        return temperature;
    }

    public void setTemperature(float temperature) {
        this.temperature = temperature;
    }

    public float getHumidity() {
        return humidity;
    }

    public void setHumidity(float humidity) {
        this.humidity = humidity;
    }

    public float getPressure() {
        return pressure;
    }

    public void setPressure(float pressure) {
        this.pressure = pressure;
    }


}
